package com.itheima.reggie.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

//套餐菜品关系
@ApiModel("套餐菜品关系")
@Data
public class SetmealDish implements Serializable {

    @ApiModelProperty("主键")
    private Long id;//主键

    @ApiModelProperty("套餐id")
    private Long setmealId;//套餐id

    @ApiModelProperty("菜品id")
    private Long dishId;//菜品id

    @ApiModelProperty("菜品名称")
    private String name;//菜品名称 （冗余字段）

    @ApiModelProperty("菜品原价")
    private BigDecimal price;//菜品原价

    @ApiModelProperty("份数")
    private Integer copies;//份数

    @ApiModelProperty("排序")
    private Integer sort;//排序

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime; //创建时间

    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime; //更新时间

    @ApiModelProperty("/创建用户")
    @TableField(fill = FieldFill.INSERT)
    private Long createUser; //创建用户

    @ApiModelProperty("更新用户")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser; //更新用户

    //是否删除
    @ApiModelProperty("是否删除")
    @TableLogic(value = "0",delval = "1")
    private Integer isDeleted;
}